import { registerDecorator, ValidationOptions } from 'class-validator';
import { IsValidAvatarPath } from 'src/validators/validatorsAvatar';

export function IsAvatarPath(validationOptions?: ValidationOptions) {
  return (object: object, propertyName: string) => {
    registerDecorator({
      target: object.constructor,
      propertyName: propertyName,
      options: validationOptions,
      constraints: [],
      validator: IsValidAvatarPath,
    });
  };
}
